package com.game.doudizhu.model;

import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import java.time.LocalDateTime;

@Data
@Entity
@EqualsAndHashCode(callSuper = true)
@DiscriminatorValue("AI")
public class AIPlayer extends Player {
    
    public AIPlayer() {
        super();
        this.setUsername("AI玩家");
        this.setReady(true);
        this.setPassword("AI_PASSWORD");
        this.setStatus("ACTIVE");
        this.setOnline(true);
        this.setRegisterTime(LocalDateTime.now());
    }
    
    public static AIPlayer createAIPlayer(String name) {
        AIPlayer ai = new AIPlayer();
        ai.setUsername(name);
        return ai;
    }
    
    @Override
    public String toString() {
        return "AIPlayer{" +
                "id=" + getId() +
                ", username='" + getUsername() + '\'' +
                '}';
    }
} 